﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Navigation;

namespace WindowsPhoneAudioStreaming.SampleApplication
{
    public partial class StreamSelector : PhoneApplicationPage
    {
        public StreamSelector()
        {
            InitializeComponent();

            DataContext = App.ViewModel;
        }

        /// <summary>
        /// Had to put this method into the code behind,as behaviour was throwing exception
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lbStreams_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.NavigationService != null && this.NavigationService.CanGoBack)
            {
                this.NavigationService.GoBack();
            }
        }

    }
}